<!DOCTYPE html>
<html>
  <head>
    <title>ancestor selector.html</title>
	
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <script type="text/javascript" src="../javascript/lib/jquery-1.9.1/jquery-1.9.1.min.js"></script>
	<script type="text/javascript">
		$(function(){
			alert($("form input").length);
			alert($("*").length);
			//开始
			alert($("[id^='user']").length);
			//结束
			alert($("[id$='user']").length);
			//
			alert($("[id!='userId']").length);
			//通配
			alert($("[id*='user']").length);
			//~=从输入框中抽取值时非常有用
			alert($("[id~='zoo']").length);
		});
	</script>
	
  </head>
  
  <body>
    <form>
    	<input id="userName" type="text" />
		<input id="userId" type="text" />
		<input id="userPhone" type="text" />
		<input id="addressuser" type="text" />
		<input id="zoo admin" type="text" />
		<input id="good zoo admin" type="text" />
    </form>
  </body>
</html>
